<extend name="Base:base" />

<block name="style">
<style type="text/css">
.tableC {width:90%; margin:0; margin:20px; background-color:#FFF; color:#369; font-size:14px; border:#999 0px solid; font-family:'微软雅黑'}
.tableC th{background-color:#EEE; height:40px; font-weight:normal; text-align:left; color:#333; padding-left:20px; letter-spacing:0px;}
.tableC th:focus{outline:none}
.tableC td{padding:8px 0 8px 20px; color:#777; vertical-align:top; background-color:#FFF;}
.tableC a{text-decoration:none; color:#369}
.tableC a:hover{ text-decoration:underline; color:#09C;}
</style>
</block>
<block name="maincont">
<div class="mdtitle">添加Bug</div>
<form action="addBug" enctype="multipart/form-data" method="post" id="form_addBug" >
<div id="uploadContainer" style="display:none;">
	<div id="queue"></div>
	<input id="file_upload" name="file_upload" type="file" multiple>
</div>
<table class="tableC" align="center" border="0" cellpadding="0" cellspacing="0">
    	<tr><td width="60px"><label>简介</label></td><td><input type="text" id="bug_title" value="{$bugInfo.bug_title}" name="bug_title" class="textA"></td></tr>
        <tr>
            <td><label>版本</label></td>
            <td>
            	<input type="text" name="version" class="textD">
            </td></tr>
        <tr>
            <td><label>模块</label></td>
            <td>
            	<select name="module" class="selectA">
            		<foreach name="Think.config.BUG_MODULE" item="module">
            			<option value="{$key}">{$module}</option>
            		</foreach>
            	</select>
            </td></tr>
       <tr>
            <td><label>平台</label></td>
            <td>
            	<select name="platform" class="selectA">
            		<foreach name="Think.config.BUG_PLATFORM" item="pt">
            			<option value="{$key}">{$pt}</option>
            		</foreach>
            	</select>
            </td></tr>
       <tr>
       		<td><label>级别</label></td>
       		<td><select name="level" class="selectA">
       				<foreach name="Think.config.BUG_LEVEL" item="level">
       					<option value="{$key}">{$level}</option>
       				</foreach>
       		</select>
       <tr><td valign="top"><label>详细</label></td><td><textarea id="textArea" style="height:300px;" name="bug_content" class="textareaA"></textarea></td></tr>
       <tr><td></td><td><input type="button" value="确定" id='add_submit' class="buttonA"></td></tr>
    </table>
    <input type="file" name="upFile" id="upFile" style="display:none;">
</form>
</block>

<block name="script">
<link href="__ROOT__/Public/WangEditor/css/wangEditor-1.3.12.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="__ROOT__/Public/Uploadify/uploadify.css">
<script src="__ROOT__/Public/WangEditor/js/wangEditor-1.3.12.min.js"></script>
<script src="__ROOT__/Public/Uploadify/jquery.uploadify.min.js" type="text/javascript"></script>
<script language="javascript">
$(".tableC tr:even").css("background-color","#EEE");
$(".tableC tr:odd").css("background-color","#FFF");
$("#add_submit").click(function(){
	var bugTitle = $("#bug_title").val();
	if(bugTitle == ""){
		alert("请输入标题!");
	}else{
		$("#form_addBug").submit();
	}
});

var editor = $('#textArea').wangEditor({
    uploadImgComponent:$('#uploadContainer')
});

$('#file_upload').uploadify({
	'swf'      : '__PUBLIC__/Uploadify/uploadify.swf',
	'uploader' : '{:U("Index/upLoadFile")}',   //上传的方法
	'buttonText' : '浏览图片',
	'onUploadSuccess' : function(file, data, response) {
		var imgSrc	= '__PUBLIC__/Image/Bug/'+data;
		editor.html(editor.html()+"<br><img width='200' src="+imgSrc+"><br>");
	}
});

</script>
</block>